<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/14
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>ERP系统 - 租户信息管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/font-awesome/css/font-awesome.css">
</head>
<body>
    <h3>租户信息管理</h3>
    <div class="actions">
        <shiro:hasPermission name="sys:lessee:add">
            <div>
                <a class="btn btn-primary" href="kong">添加租户信息</a>
            </div>
        </shiro:hasPermission>
        <shiro:hasPermission name="sys:lessee:select">
            <form action="search">
                <select name="field">
                    <option value="lName">姓名</option>
                    <option value="lTel">手机号</option>
                    <option value="lSex">性别</option>
                    <option value="lNativeplace">地址</option>
                    <option value="lIdcard">身份证号</option>
                </select>
                <input type="text" name="keyword" placeholder="输入关键字查询">
                <input type="submit" value="搜索">
            </form>
        </shiro:hasPermission>
    </div>

    <table class="list">
        <tr>
            <th>序号</th>
            <th>租户姓名</th>
            <th>手机号</th>
            <th>性别</th>
            <th>籍贯</th>
            <th>身份证号</th>
            <th>添加时间</th>
            <th>操作</th>

        </tr>
        <c:forEach var="lessees" items="${pageInfo.list}" varStatus="status">
            <tr>
                <td>${lessees.lId}</td>
                <td>${lessees.lName}</td>
                <td>${lessees.lTel}</td>
                <td>${lessees.lSex}</td>
                <td>${lessees.lNativeplace}</td>
                <td>${lessees.lIdcard}</td>
                <td>${lessees.lAddtime}</td>


                <td>
                    <a class="fa fa-info" title="详情" href="detail?lId=${lessees.lId}"></a>
                    &nbsp;&nbsp;
                    <shiro:hasPermission name="sys:lessee:update">
                        <a class="fa fa-pencil" title="编辑" href="find?lId=${lessees.lId}"></a>
                    </shiro:hasPermission>

                    &nbsp;&nbsp;
                    <shiro:hasPermission name="sys:lessee:delete">
                        <a class="fa fa-remove" title="删除" href="delete?lId=${lessees.lId}" onclick="confirmDelete(1)"></a>
                    </shiro:hasPermission>

                </td>
            </tr>
        </c:forEach>

    </table>
    <div class="pager-info">
        <div class="col-md-6">
            当前第${pageInfo.pageNum}页,总共${pageInfo.pages}页,总共${pageInfo.total}条记录
        </div>
        <div class="col-md-6">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li><a href="list?pn=1">首页</a></li>
                    <c:if test="${pageInfo.hasPreviousPage}">
                        <li>
                            <a href="list?pn=${pageInfo.pageNum-1}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
                        <li <c:if test="${page_Num==pageInfo.pageNum}">
                            class="active"
                        </c:if>><a href="list?pn=${page_Num}">${page_Num}</a></li>

                    </c:forEach>
                    <c:if test="${pageInfo.hasNextPage}">
                        <li>
                            <a href="list?pn=${pageInfo.pageNum+1}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <li><a href="list?pn=${pageInfo.pages}">末页</a></li>
                </ul>
            </nav>
        </div>
    </div>
    <script src="${pageContext.request.contextPath}/lib/jquery/jquery.js"></script>
    <script>
        function confirmDelete(id){
            if (confirm("确定要删除吗？")) {
                alert('发送删除请求，刷新页面（不要异步）');
            }
            return false;
        }
    </script>
</body>
</html>
